//
//  SEGFeedbackDetailViewModel.m
//  SEGViewModel
//
//  Created by 山刘 on 2020/6/1.
//

#import "SEGFeedbackDetailViewModel.h"

@implementation SEGFeedbackDetailViewModel
#pragma mark - business
-(void)requestSendReplyWithContextWithId:(NSString *)sugIdStr WithContext:(NSString *)contextStr completed:(void(^)(NSString * code,NSString * message))completed{
    [SEGUserFeedbackManager requestSendReplyWithContext:contextStr SugId:sugIdStr Finished:^(id result, NSError *error) {
        NSString *code = [result objectForKey:@"code"];
        completed(code,[result objectForKey:@"message"]);
    }];
}

-(void)requestFeedbackDetailWithSugId:(NSString *)sugIdStr completed:(void(^)(NSString * code))completed{
    [SEGUserFeedbackManager requestFeedbackDetailWithSugId:sugIdStr Finished:^(id result, NSError *error) {
        NSString *code = [result objectForKey:@"code"];
        if ([code isEqualToString:@"0"]){
            self.listData = result;
        }
        completed(code);
    }];
}
#pragma mark - getter
@end
